package com.sky.zero.dict.controller;

import com.github.pagehelper.PageInfo;
import com.sky.zero.dict.entity.Dict;
import com.sky.zero.dict.entity.DictParam;
import com.sky.zero.dict.entity.DictVO;
import com.sky.zero.dict.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/dict1")
public class DictController1 {

	@Autowired
	private DictService dictService;

	/** 查询列表(分页) **/
	@RequestMapping("/getDictPage")
    public PageInfo<DictVO> getDictPage(DictParam param){
		return dictService.getDictPage(param);
	}

	/** 查询列表 **/
	@RequestMapping("/getDictList")
    public List<DictVO> getDictList(DictParam param) {
		return dictService.getDictList(param);
	}

	@RequestMapping("/getDictById")
	public DictVO getDictById(Integer id) {
		return dictService.getDictById(id);
	}

	/**新增**/
	@RequestMapping("/addDict")
    public Integer addDict(Dict param) {
 	    return dictService.insertDict(param);
     }

    /**批量新增**/
	@RequestMapping("/addBatchDict")
    public Integer addBatchDict(List<Dict> paramList) {
 	    return dictService.insertBatchDict(paramList);
     }

    /**编辑**/
	@RequestMapping("/editDict")
    public Integer editDict(Dict param) {
 	    return dictService.updateDict(param);
     }

    /**批量编辑**/
	@RequestMapping("/editBatchDict")
    public Integer editBatchDict(List<Dict> paramList) {
 	    return dictService.updateBatchDict(paramList);
     }

	 @RequestMapping("/delDictById")
	public Integer delDictById(Integer id) {
		return null;
	}

	@RequestMapping("/delDictByIds")
	public Integer delDictByIds(List<Integer> ids) {
		return null;
	}

}